<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

use think\facade\Route;

/**
 * 题目管理路由
 */

// 题目管理路由
Route::group('question', function () {
    // 题目列表
    Route::get('', 'crud.Question/index');
    // 题目详情
    Route::get(':id', 'crud.Question/read');
    // 创建题目
    Route::post('', 'crud.Question/save');
    // 更新题目
    Route::put(':id', 'crud.Question/update');
    // 删除题目
    Route::delete(':id', 'crud.Question/delete');
    // 修改状态
    Route::put('set_status/:id', 'crud.Question/set_status');
})->middleware([
    \app\http\middleware\AllowOriginMiddleware::class,
    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
    \app\adminapi\middleware\AdminCkeckRoleMiddleware::class,
    \app\adminapi\middleware\AdminLogMiddleware::class
]);

// 题目分类管理路由
Route::group('question_category', function () {
    // 分类列表
    Route::get('', 'crud.QuestionCategory/index');
    // 树形分类列表
    Route::get('tree', 'crud.QuestionCategory/tree');
    // 创建分类
    Route::post('', 'crud.QuestionCategory/save');
    // 更新分类
    Route::put(':id', 'crud.QuestionCategory/update');
    // 删除分类
    Route::delete(':id', 'crud.QuestionCategory/delete');
})->middleware([
    \app\http\middleware\AllowOriginMiddleware::class,
    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
    \app\adminapi\middleware\AdminCkeckRoleMiddleware::class,
    \app\adminapi\middleware\AdminLogMiddleware::class
]);

